Skip to content

Recapitalize word at cursor with Shift - #2205

Open
djurcola wants to merge 5 commits into
futo-org:masterfrom
djurcola:feat/recapitalize-word-at-cursor
Open

Recapitalize word at cursor with Shift#2205
djurcola wants to merge 5 commits into
futo-org:masterfrom
djurcola:feat/recapitalize-word-at-cursor

Conversation

@djurcola

@djurcola djurcola commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • recapitalize the word at or adjacent to the cursor when Shift is pressed without a selection
  • retain the existing selected-text recapitalization cycle
  • preserve the input-start safety guard for selected-text recapitalization while validating the cursor-only path directly
  • accept a recapitalized word before Space or punctuation is inserted, preventing both stale auto-correction and replacement of the recapitalization selection
  • add coverage for word boundaries, Unicode, repeated Shift cycling followed by Space, and punctuation/whitespace no-op cases

Fixes #1587

Validation

  • git diff --check
  • Android APK build and release completed successfully in the related custom integration build: https://github.com/djurcola/android-keyboard/actions/runs/31008152288
  • Device regression test pending upstream review/build: type tgis, press Shift once or twice, then Space; the selected casing must remain and the separator must be inserted after it.

@djurcola djurcola closed this Aug 5, 2026
@djurcola
djurcola deleted the feat/recapitalize-word-at-cursor branch August 5, 2026 11:39
@djurcola djurcola reopened this Aug 6, 2026
@la-la-lars

Copy link
Copy Markdown

I just tried the dev build and wanted to give feedback: while this is a godsend for typing in German, it makes typing something voluntarily in camelCase practically impossible because you cannot continue appending a capital letter to a word.
Long-pressing the Shift key or a gesture involving Shift would be better IMO.

@djurcola

Copy link
Copy Markdown
Author

I just tried the dev build and wanted to give feedback: while this is a godsend for typing in German, it makes typing something voluntarily in camelCase practically impossible because you cannot continue appending a capital letter to a word. Long-pressing the Shift key or a gesture involving Shift would be better IMO.

Long press is a great idea! I will implement that.

@la-la-lars

Copy link
Copy Markdown

Long press is a great idea! I will implement that.

Actually, long- press might be not that great thinking about cycling through the capitalization variants (which is absolutely useful), as it incurs multiple delays. A gesture might be a better solution. With the old Swype/Dragon keyboard it was a short swipe gesture from a neighboring key to the shift key. Here, that could be swiping from the numeric switch button to the shift key.

@Felix14-v2

Copy link
Copy Markdown

typing something voluntarily in camelCase practically impossible

Alternative solution: detect compound words and apply camelCase to them as a capitalization option

@la-la-lars

Copy link
Copy Markdown

Alternative solution: detect compound words and apply camelCase to them as a capitalization option

I'm not the owner of this PR and can't speak for @djurcola, but IMHO that would not be an alternative but another feature altogether (another capitalization style), while this is about just a more convenient way of invoking the already known capitalization.

@djurcola

djurcola commented Aug 11, 2026

Copy link
Copy Markdown
Author

I am testing a few options:

  1. Hold shift to cycle through options. Caps lock changed to double tap.
  2. Swipe right - I use swipe left to delete the last word so this works good for me.
  3. Swipe up. This one is a bit tricky on my height keyboard, I find it gets confused and inserts a number over the word instead.

Currently enjoying 1 and 2 the most.

Check my custom build on my profile if you want to try it.

https://github.com/djurcola/android-keyboard/actions/runs/31540741039

All the options are under swipe keyboard settings currently, will need to clean that up.

@la-la-lars

la-la-lars commented Aug 12, 2026

Copy link
Copy Markdown

Just tried it. Holding shift works much better than expected thanks to the delay being short enough 👍
But: All the swipe left/right/up options conflict with general swipe typing (which I normally use and the biggest reason to use FUTO) though, even to the degree that the keyboard just crashes when both are enabled. Even if I disable all three, I get a crash on swipe typing 🙁
My suggestion was a local swipe gesture specifically from the special character switch key to the shift key. But now I'm not entirely sure if that would be better than holding shift.

@djurcola

djurcola commented Aug 12, 2026

Copy link
Copy Markdown
Author

I will remove those from the pull request, I have them since I don't use swiping but do like swipe left to delete!

I will adjust the functionality to hold shift as that is what I have used the most. Swipe from shift key was too precise for my fat fingers and I always missed the button.

@EmilJunker

Copy link
Copy Markdown

I would like to propose an alternative implementation that avoids the issue with camelCase altogether. How about when the user types the word "hello" and then presses the shift key while the cursor is still adjacent to the word, Futo simply shows "Hello" in the suggestion bar. And when the user presses shift again, it shows "HELLO" in the suggestion bar. This allows the user to easily capitalize the word without interfering with the typed text or the ability to write camelCase.

@la-la-lars

la-la-lars commented Aug 14, 2026

Copy link
Copy Markdown

My 2 cents: while @EmilJunker 's suggestion would work, it would in most cases double needed key strokes. Think long german combined words, which are mostly nouns, first suggested change is simple capitalizarion. Hold shift = one click and no need to look for the desired variant VS hold shift + select the desired variant = two clicks and felt broken flow. At least unless combined with option suggestion bar mode = 2 alternatives which I strongly dislike!
Re camelCaae: neither a problem with hold shift interaction (just type camel case and keep it), nor would I think it worth an extra variant - you wouldn't want to start there and continue with PascalCase, kebab-case, .....

Therefore, I'd rather keep @djurcola 's idea.

@la-la-lars

Copy link
Copy Markdown

I will remove those from the pull request, I have them since I don't use swiping but do like swipe left to delete!

I will adjust the functionality to hold shift as that is what I have used the most. Swipe from shift key was too precise for my fat fingers and I always missed the button.

@djurcola once you can fix the swiping conflict I'd be happy to test a new dev build 😊

Then, is there anything one can do to help getting the PR accepted?

@djurcola

Copy link
Copy Markdown
Author

Hey Guys, it is pretty hard to get a feature merged here so I am going to leave the current build as is, which has all options available (and able to be toggled on off) for now. I don't think they will approve the hold shift as that is currently mapped to caps.

@abb128

abb128 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

I'll reopen this to look at when I get around to it but I wasn't very happy about some of the proposed behavior, namely that recapitalizing skips autocorrect. Over the past month I've been occupied with the voice input app so I've not had the chance to review this properly unfortunately. Sorry about the silence.

@abb128 abb128 reopened this Sep 1, 2026
@djurcola

djurcola commented Sep 1, 2026

Copy link
Copy Markdown
Author

No worries @abb128 - but the current PR is not suitable for merging, it was just a test of a few different features / options and is a bit of a mess. If there is one method that is preferred (everyone seems to like the hold shift) I can clean it up and update the PR.

@la-la-lars

Copy link
Copy Markdown

I wasn't very happy about some of the proposed behavior, namely that recapitalizing skips autocorrect.

I'd like to note that doing recapitalization without applying autocorrect may well be desired - see example for compound German nouns in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Capitalize word at cursor

6 participants